package com.zhouk.ams.schedule;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * Create By Zhouke on 2017/12/06
 */
@Configuration
@EnableScheduling
public class MyScheduleConfig {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    /**
     *  定义调度器 一分钟执行一次
     */
    @Scheduled(cron = "0 0/1 * * * ?")
    public void job1() {

        logger.info("this is a job execute");

    }

}
